<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<style type="text/css">
  body > div { width: 100px }
  #stf1 { float: left }
  #stf2 { position: absolute }
  #stf3 { display: table-cell }
</style>
<div>
  <div id="stf1">
    <svg viewBox='0 0 1 1'></svg>
  </div>
  <div id="stf2">
    <svg viewBox='0 0 1 1'></svg>
  </div>
  <div id="stf3">
    <svg viewBox='0 0 1 1'></svg>
  </div>
</div>
<script>
    test(function() {
        var r = document.getElementById('stf1').getBoundingClientRect();
        assert_equals(r.width, 0);
    }, "Test floated element width with replaced element with intrinsic ratio but no dimensions");
    test(function() {
        var r = document.getElementById('stf2').getBoundingClientRect();
        assert_equals(r.width, 0);
    }, "Test absolute positioned element width with replaced element with intrinsic ratio but no dimensions");
    test(function() {
        var r = document.getElementById('stf3').getBoundingClientRect();
        assert_equals(r.width, 0);
    }, "Test table cell width with replaced element with intrinsic ratio but no dimensions");
</script>
